home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / Q-R / RR⁄Tabby Source Code Folder / Mantissa 1.0.source < prev    next >
Encoding:
Text File  |  1990-05-25  |  61.2 KB  |  1,900 lines  |  [TEXT/MACA]

  1.  
  2.      ' Code by:      Mike Lininger
  3.      '               385 Bowling Green Place 
  4.      '               Gahanna, Ohio  43230
  5.      '               (614) 471-6209 (BBS)
  6.  
  7. 5-25-90
  8.  
  9. I am making most of my code available to anyone interested in developing 
  10. their own Second Sight/Tabby utilities.  This source is not designed to be 
  11. compiled and run.  It is missing key functions and pieces of code that are 
  12. Copyright me and others, that are not to be released at this time. 
  13.  
  14. This code is for example purposes only.  It illustrates various ways of reading
  15. writing and process data from a variety of SS/Tabby files.  It illustrates
  16. the use of Block Reads and Indexes amoung other things.
  17.  
  18. If you use any portion of this code you must abide by two rules, or you
  19. void the agreement that I am making with you and are subject what the law
  20. dictates.
  21.  
  22. They are simple. 
  23.  
  24. 1.  If you us any of this code you must give Michael Lininger and Lininger 
  25. Technology credit in both the program and the documentation.
  26.  
  27. 2.  It is agreed I am to receive a free copy of the program whether it is 
  28. free, sharware or commercial.
  29.  
  30. Now you must read on a little further and we will be done.
  31.  
  32. A little history on why I choose ZBasic as the root for my utilities.
  33. I use to be one of those people that would smirk every time someone mentioned
  34. they were using BASIC (until 3 years ago I and others had ever right to
  35. smirk) and would say how nice.  But thought yeh!  Real programmers only use
  36. C or Assembler.
  37.  
  38. Then came along Microsofts QuickBasic for the IBM.  This baby was hot 
  39. it gave you all features of C and Pascal, plus core logic of Assembler, 
  40. all packaged into a neat super easy to learn and use package.  This cut out
  41. months of development work plus the finial applications were a hell of a lot 
  42. better looking, cause you could do so much in a short period of time.  
  43. This set the tide for a new generation of Basic's.  Zedcor introduced ZBasic 
  44. for the mac, which gave complete control over the toolbox plus it compiled 
  45. into nice neat assembly and was fast. 
  46.  
  47. ZBasic I have found to be extremely powerful and fast, in most cases it 
  48. matches or out performs the best C compilers out there. Now when someone 
  49. says heh I finished this great C project that I have been working on for 6 
  50. months, I now smirk and say how nice.  But think yeh!  I could have done 
  51. the same thing in 1/4 the time and saved you 300,000.00 and ended up with 
  52. a lot cleaner and more professional looking product all at the cost of an 
  53. extra 14k of file size.
  54.  
  55. The only draw back to ZBasic is it lack of Data structures, but this is
  56. made up for the use of Indexes.  C programmer salivate all over the place
  57. at the mention of theses babies.  They give you performance you never dreamed
  58. of.  Now of we could just get Zedcor to give us a dozen more, WOW.
  59.  
  60. Moral of the story - DO NOT EVER underestimate the POWER of Compiled Basic.
  61.  
  62. Have at it.  I hope a lot of people will use this as a jumping off point
  63. and dive into creating a flood of new SS/Tabby utilities.
  64.  
  65. I can be reached on the networks if you have questions.
  66.  
  67.         614-471-6209 9600 baud
  68.         614-471-5733 2400 baud
  69.  
  70.         M.Lininger  Genie
  71.         Mike Lininger FidoNet (Tabby, RRH, MANSION echoes)
  72.         Mike Lininger 1:226/200
  73.         Mike Lininger via cmhGate - Net 226 fido<=>uucp gateway Col, OH
  74.         UUCP: ...!ous-cis!n8emr!cmhgate!200.2!Mike.Lininger
  75.         INET: Mike.Lininger@p2.f200.n226.z1.FIDONET.ORG
  76.  
  77.  
  78.  
  79.     ' This is 1.0 release code.  3.2 is still sharware see end of this code
  80.     ' for details on Mantissa 3.2
  81.  
  82.     ' Code is in ZBasic 5.0
  83.     ' Settings 8,2,4,5,50,mklt,TEXT,LONG,Space Req. after Keywords
  84.     '
  85.     ' Start date: 02-08-89
  86.     ' Last modify date: 03-08-90
  87.     ' Version: 1.0
  88.     ' Message Base management system for RRH and Tabby
  89.     ' Creator: MKLm
  90.     ' Type: Mtsa
  91.  
  92.  
  93.      ' To Prevent your application from say "You will not be able to print"
  94.      ' if it does not find a Print Driver in your system do the following
  95.      ' on the finial campiled application.  DO NOT DO IT ON ZBASIC ITSELF.
  96.      ' Use FEDIT do a Hex search for 50EDFD3C and change 50ED to FD3C.
  97.  
  98.      ' Sets up application.  Turns off Startup Window, Sets Default Mouse
  99.      WINDOW OFF
  100.      COORDINATE WINDOW
  101.      DEF MOUSE=-1
  102.      WIDTH -2
  103.      FLUSHEVENTS
  104.  
  105.      DIM T%,L%,B%,R%,MY%,MX%:    ' Required for Toolbox calls
  106.  
  107.      DIM 80 Tabby$(100)
  108.      DIM 25 MsgName$(255):       ' Storage area for Message Base Section Names
  109.      DIM SectionLimit%(255):     ' Storage area for Message section limits
  110.      DIM SectionCount%(255):     ' Storage area for Active Msg Section counts
  111.      DIM SectionDay%(255):       ' Storage area for Message Day Limit
  112.      DIM SectionDelete%(255):    ' Storage area for deleted message counts
  113.      DIM 1 MsgType$(255):
  114.      DIM 1 MessageSection$(255):
  115.      DIM 1 Backup$(255):
  116.  
  117.      RRHost$="Red Ryder Host"
  118.      Memory&=MEM(-1)
  119.      a&=82400
  120.      b&=128000
  121.      c&=9242
  122.      LONG IF a&+b&+c&+20000 > Memory&
  123.           a&=41200
  124.           b&=64000
  125.           LONG IF a&+b&+c&+20000 > Memory&
  126.                a&=20600
  127.                b&=32000
  128.                LONG IF a&+b&+c&+20000 > Memory&
  129.                     a&=10300
  130.                     b&=16000
  131.                     LONG IF a&+b&+c&+20000 > Memory&
  132.                         a&=5150
  133.                         b&=8000
  134.                         LONG IF a&+b&+c&+20000 > Memory&
  135.                              ErrLine$="*** Not Enough Memory *** "
  136.                              GOSUB "Error Log"
  137.                              ErrLine$="*** Minimum Memory Needed:"+STR$(a&+b&+c&+10000) +" *** "
  138.                              GOSUB "Error Log"
  139.                              ErrLine$="***  Max Memory Available:"+STR$(Memory&)+" *** "
  140.                              GOSUB "Error Log"
  141.                              GOSUB "Get_Resource_Values"
  142.                              NextLaunch$=BBSFolder$+"Launch.Next"
  143.                              TabbyNet$=BBSFolder$+"TabbyNet"
  144.                              RRHost$=BBSFolder$+RRHost$
  145.                              GOSUB "Tabby_Launch"
  146.                              ErrLine$ = "<<Error MM>> Everything Failed to Launch, Dropping to Finder, Memory Problems! "
  147.                              GOSUB "Error Log"
  148.                              END 
  149.                        END IF
  150.                    END IF
  151.                END IF
  152.           END IF
  153.           ErrLine$="***  Low on Memory, Cache Size Reduced, so is performance! "+STR$(Memory&)
  154.           GOSUB "Error Log"
  155.      END IF
  156.  
  157.      CLEAR a&,0
  158.      CLEAR b&,1
  159.      CLEAR c&,2
  160.  
  161.      Field%=1:ERROR=0:Cur%=128
  162.      Start&=TIMER     
  163.  
  164.     ' Initialize all need variables
  165.     FOR j%=1 TO 255
  166.          SectionLimit%(j%)=999
  167.          SectionCount%(j%)=0
  168.          SectionDelete%(j%)=0
  169.          SectionDay%(j%)=365
  170.             MsgName$(j%)=""
  171.     NEXT j%
  172.      ' Initialize Tabby$() to null's
  173.      
  174.      FOR j% = 1 TO 100
  175.          Tabby$(j%)=""
  176.      NEXT j%
  177.      
  178.  
  179.      ' This function turns a Pascal-encoded string into ZBasic-usable form
  180.  
  181.      DEF FN MakeString$(String$) = MID$(String$, 2, ASC(LEFT$(String$,1)))
  182.  
  183.   
  184.      ' convert string resource to a string, handle must be passed to this function
  185.  
  186.      LONG FN ReturnString$(SHndl&)
  187.      
  188.              FByte%=PEEK(PEEK LONG(SHndl&))
  189.              String$=""
  190.       
  191.              FOR I%=1 TO FByte%
  192.                     String$=String$+CHR$(PEEK(PEEK LONG(SHndl&)+I%))
  193.              NEXT I%
  194.      
  195.      END FN = String$
  196.  
  197.      ' Builds main process window
  198.  
  199.      GOSUB "Get_Resource_Values"
  200.      GOSUB "Cursor_Spin"
  201.  
  202.      ' Checks to see if mouse key is down, if so then goto configure menu
  203.   
  204.      MOUSE ON
  205.      DEF MOUSE = 0
  206.      Hold%=MOUSE(3)
  207.      LONG IF Hold% <> 0
  208.  
  209.          GOSUB "Cursor_Spin"
  210.          DEF MOUSE = -1
  211.          WINDOW CLOSE #1
  212.          GOSUB "Configure Menu"
  213.          CURSOR 0
  214.          IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  215.          END
  216.  
  217.      END IF
  218.      MOUSE OFF
  219.      DEF MOUSE = -1
  220.  
  221.      WINDOW 2,"",(120,57)-(370,290),2
  222.      MENU 1,0,1,"File"
  223.      EDIT MENU 2
  224.      MENU 3,0,0,"Aurora Borealis  614-471-6209"
  225.      'RefNum%=FN OPENRESFILE("dd80:ZBasic:Mantissa.pict") 
  226.      Pict&=FN GETRESOURCE(CVI("PICT"),24610)
  227.      PICTURE(120,0),Pict&
  228.      T%=127:L%=47:B%=159:R%=79
  229.      CALL PLOTICON(T%,FN GETICON(257))
  230.      TEXT 3,9,0,0
  231.      T%=164:L%=7:B%=180:R%=120:TEMP$="by"
  232.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 1)
  233.      TEXT 0,12,0,0
  234.      T%=184:L%=7:B%=200:R%=120:TEMP$="Michael Lininger"
  235.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 1)
  236.      T%=210:L%=7:B%=226:R%=120:TEMP$="•••••••••••••••"
  237.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 1)
  238.      GOSUB "Cursor_Spin"
  239.  
  240.     IF LEN(BBSFolder$) <= 1 THEN BBSFolder$=""
  241.     NextLaunch$=BBSFolder$+"Launch.Next"
  242.     TabbyNet$=BBSFolder$+"TabbyNet"
  243.     RRHost$=BBSFolder$+RRHost$
  244.     ConfigFile$=BBSFolder$+"Config"
  245.     IF RRHost$="" THEN RRHost$="Red Ryder Host"
  246.           
  247.     GOSUB "Config_Read"
  248.     GOSUB "Cursor_Spin"
  249.     GOSUB "Messages_Read"
  250.  
  251.     IF LEN(Archive$) <= 1 THEN Archive$=MsgPath$+":"
  252.  
  253.     CALL PENNORMAL
  254.     CIRCLE 60,50,44
  255.     PEN 2,2,,,
  256.     CIRCLE 60,50,40
  257.     PEN,,1,9,3
  258.     ScreenLine$="* Delete Scan *"
  259.     GOSUB "Screen_Log_Display"
  260.     
  261.     MsgHdrBak$=MsgHdrFilename$+".$$$"
  262.     MsgTxtBak$=MsgTxtFilename$+".$$$"
  263.        MessageBak$=MessagesFile$+".$$$"
  264.        MsgHdrTemp$=MsgHdrFilename$+".tmp"
  265.        HdrBak$=MsgHdrFilename$+".bak"
  266.        TxtBak$=MsgTxtFilename$+".bak"
  267.        MsgBak$=MessagesFile$+".bak"
  268.     GOSUB "Cursor_Spin"
  269.        
  270.        
  271.     ON ERROR GOSUB "SystemFile_Error"
  272.  
  273.     ErrLine$="<<Error HB1>> *":ErName$=HdrBak$
  274.        OPEN "N",1,HdrBak$
  275.     ErrLine$="<<Error HB1-1>> *"
  276.        CLOSE #1
  277.     ErrLine$="<<Error HB1-2>> *"
  278.        KILL HdrBak$
  279.     ErrLine$="<<Error TB1>> *":ErName$=TxtBak$
  280.        OPEN "N",1,TxtBak$
  281.     ErrLine$="<<Error TB1-1>> *"
  282.        CLOSE #1
  283.     ErrLine$="<<Error TB1-2>> *"
  284.        KILL TxtBak$
  285.     ErrLine$="<<Error MB1>> *":ErName$=MsgBak$
  286.        OPEN "N",1,MsgBak$
  287.     ErrLine$="<<Error MB1-1>> *"
  288.        CLOSE #1
  289.     ErrLine$="<<Error MB1-2>> *"
  290.        KILL MsgBak$
  291.  
  292.     ErrLine$="<<Error S1>> *":ErName$=Settings$
  293.     OPEN "I",1,Settings$
  294.     WHILE NOT EOF(1)
  295.          ErrLine$="<<Error S1-1>> *"
  296.          LINE INPUT #1,line$
  297.          LONG IF LEFT$(line$,1) <> "*"
  298.               SecA%=VAL(LEFT$(line$,3))
  299.               DayB%=VAL(MID$(line$,5,3))
  300.               LimitC%=VAL(MID$(line$,9,3))
  301.               SectionLimit%(SecA%)=LimitC%
  302.               SectionDay%(SecA%)=DayB%
  303.               Backup$(SecA%)=MID$(line$,13,1)
  304.          END IF
  305.      WEND
  306.      CLOSE #1
  307.      GOSUB "Cursor_Spin"
  308.  
  309.      date$=DATE$
  310.           Day%=VAL(MID$(date$,4,2))
  311.           Month%=VAL(LEFT$(date$,2))
  312.           Year%=VAL(RIGHT$(date$,2))
  313.           Today&=(365*Year%)+(30.5*Month%)+Day%
  314.  
  315.           ErrLine$="<<Error H1>> *":ErName$=MsgHdrFilename$
  316.           OPEN "N",1,MsgHdrFilename$
  317.           R_MsgCount&=a&
  318.           R_MsgLength&=LOF(1,1)
  319.           LONG IF R_MsgLength& < R_MsgCount&
  320.                R_MsgCount&=R_MsgLength&
  321.           END IF
  322.           GOSUB "Cursor_Spin"
  323.  
  324.           Position&=R_MsgLength&-R_MsgCount&
  325.           IF Position& < 0 THEN Position&=0:Full%=1
  326.           BytesLeft&=R_MsgLength&
  327.           Loop%=0
  328.  
  329.           ErrLine$="<<Error TT1>> *":ErName$=MsgTxtFilename$
  330.           OPEN "N",12,MsgTxtFilename$
  331.  
  332.           DEF OPEN "MSGSMGED"
  333.           ErrLine$="<<Error HT1>> *":ErName$=MsgHdrTemp$
  334.           OPEN "N",2,MsgHdrTemp$
  335.  
  336.           WHILE Loop%=0
  337.                GOSUB "Cursor_Spin"
  338.                ErrLine$="<<Error H2>> *":ErName$=MsgHdrFilename$
  339.                RECORD #1,0,Position&
  340.                ErrLine$="<<Error H2-2>> *"
  341.                READ FILE #1,MEM(0+40),R_MsgCount&
  342.                TotalBytes&=TotalBytes&+R_MsgCount&
  343.                RecordCount%=R_MsgCount&/206
  344.                x&=R_MsgCount&-206
  345.                FOR j%=1 TO RecordCount%
  346.                     GOSUB "Cursor_Spin"
  347.                     Status$=CHR$(PEEK(MEM(0+40)+x&))
  348.                     Section%=CVI(CHR$(PEEK(MEM(0+40)+x&+6)))
  349.                     Day%=CVI(CHR$(PEEK(MEM(0+40)+x&+9)))
  350.                     Month%=CVI(CHR$(PEEK(MEM(0+40)+x&+8)))
  351.                     Year%=CVI(CHR$(PEEK(MEM(0+40)+x&+10)))
  352.                     DayResult&=(365*Year%)+(30.5*Month%)+Day%
  353.  
  354.                     LONG IF ((ASC(Status$) AND 1) = 1) 
  355.                          UserDelete&=UserDelete&+1
  356.                          SectionDelete%(Section%)=SectionDelete%(Section%)+1
  357.                          LONG IF Backup$(Section%) = "1"
  358.                               BPtr&=x&
  359.                               GOSUB "Backup_Message"
  360.                          END IF
  361.                          GOTO "Delete_Skip"
  362.                     END IF
  363.                     LONG IF SectionDay%(Section%) > 0
  364.                          LONG IF DayResult& < Today&-SectionDay%(Section%)  AND b3%=2 OR SectionCount%(Section%) >= SectionLimit%(Section%) AND b4%=2
  365.                               LONG IF DayResult& < Today&-SectionDay%(Section%)  AND b3%=2
  366.                                    DayDelete&=DayDelete&+1
  367.                               XELSE
  368.                                    LimitDelete&=LimitDelete&+1
  369.                               END IF
  370.                               Status%=ASC(Status$)
  371.                               Status%=Status%+1
  372.                               POKE MEM(0+40)+x&,Status%
  373.                               SectionDelete%(Section%)=SectionDelete%(Section%)+1
  374.                               LONG IF Backup$(Section%) = "1"
  375.                                    BPtr&=x&
  376.                                    GOSUB "Backup_Message"
  377.                               END IF
  378.                               GOTO "Delete_Skip"
  379.                          END IF
  380.                      END IF
  381.                      SectionCount%(Section%)=SectionCount%(Section%)+1
  382.                      Active%=Active%+1
  383. "Delete_Skip"
  384.                      x&=x&-206
  385.                 NEXT j%
  386.  
  387.                 ErrLine$="<<Error HT2>> *":ErName$=MsgHdrTemp$
  388.                 RECORD #2,0,Position&
  389.                 ErrLine$="<<Error HT2-2>> *"
  390.                 WRITE FILE #2,MEM(0+40),R_MsgCount&
  391.                 Position&=Position&-R_MsgCount&
  392.                 BytesLeft&=BytesLeft&-R_MsgCount&
  393.                 IF Full%=1 THEN Loop%=1
  394.                 LONG IF Full%=0
  395.                     IF BytesLeft&-R_MsgCount& < 0 THEN Full%=1:R_MsgCount&=BytesLeft&:Position&=0
  396.                 END IF
  397.                 GOSUB "Cursor_Spin"
  398.                 radii%=40*TotalBytes&/R_MsgLength&
  399.                 CIRCLE FILL 60,50,radii%
  400.           WEND
  401.           ErrLine$="<<Error H2-3>> *":ErName$=MsgHdrFilename$
  402.           CLOSE #1
  403.           ErrLine$="<<Error HT2-3>> *":ErName$=MsgHdrTemp$
  404.           CLOSE #2
  405.           ErrLine$="<<Error TT1-3>> *":ErName$=MsgTxtFilename$
  406.           CLOSE #12
  407.           RESET
  408.           GOSUB "Cursor_Spin"
  409.           CALL PENNORMAL
  410.                      
  411.  
  412.      ScreenLine$="* Backup Scan *"
  413.      GOSUB "Screen_Log_Display"
  414.      R_MsgPosition&=0
  415.      R_MsgCount&=a&
  416.      R_MsgLength&=0
  417.  
  418.      N_MsgPosition&=0
  419.      N_TotalBytes&=0
  420.      LowMessage&=0
  421.  
  422.      Position&=0
  423.      NewPosition&=0
  424.      Active%=0
  425.      Delete%=0
  426.  
  427.  
  428.           ErrLine$="<<Error HT3>> *":ErName$=MsgHdrTemp$
  429.           OPEN "N",1,MsgHdrTemp$
  430.           ErrLine$="<<Error T1>> *":ErName$=MsgTxtFilename$
  431.           OPEN "N",3,MsgTxtFilename$
  432.           DEF OPEN "MSGSMGED"
  433.           ErrLine$="<<Error HB2>> *":ErName$=MsgHdrBak$
  434.           OPEN "N",2,MsgHdrBak$
  435.           ErrLine$="<<Error TB2>> *":ErName$=MsgTxtBak$
  436.           OPEN "N",4,MsgTxtBak$
  437.           GOSUB "Cursor_Spin"
  438.  
  439.           R_MsgLength&=LOF(1,1)
  440.           LONG IF R_MsgLength& < R_MsgCount&
  441.                R_MsgCount&=R_MsgLength&
  442.           END IF
  443.  
  444.           OldPosition&=0
  445.           NewPosition&=0
  446.           Counter&=0
  447.           TxtBytes&=0
  448.           HighMessage&=0
  449.           LowMessage&=0
  450.           N_TotalBytes&=0
  451.  
  452.           WHILE NOT EOF(1)
  453.                GOSUB "Cursor_Spin"
  454.                ErrLine$="<<Error HT4>> *":ErName$=MsgHdrTemp$
  455.                RECORD #1,0,R_MsgPosition&
  456.                ErrLine$="<<Error HT4-2>> *"
  457.                READ FILE #1,MEM(0+40),R_MsgCount&
  458.                RecordCount%=R_MsgCount&/206
  459.                x&=0
  460.                FOR j%=1 TO RecordCount%
  461.                     GOSUB "Cursor_Spin"
  462.                     Status$=CHR$(PEEK(MEM(0+40)+x&))
  463.                     Day%=CVI(CHR$(PEEK(MEM(0+40)+x&+9)))
  464.                     Month%=CVI(CHR$(PEEK(MEM(0+40)+x&+8)))
  465.                     Year%=CVI(CHR$(PEEK(MEM(0+40)+x&+10)))
  466.                     DayResult&=(365*Year%)+(30.5*Month%)+Day%
  467.                     LONG IF ((ASC(Status$) AND 1) = 1)
  468.                        Delete%=Delete%+1
  469.                        GOSUB "File_Dump"
  470.                        TxtBytes&=0
  471.                        BytesWritten&=0
  472.                        OldPosition&=OldPosition&+PEEK LONG (MEM(0+40)+x&+192)
  473.                        ' take into account length of deleted message
  474.  
  475.                     XELSE
  476.  
  477.                          MessageNumber& = PEEK LONG(MEM(0+40)+x&+2)
  478.                          OFFSet&=PEEK LONG(MEM(0+40)+x&+188)
  479.                          MsgBytes&=PEEK LONG(MEM(0+40)+x&+192)
  480.  
  481.                          HighMessage&=MessageNumber&
  482.                          IF LowFlag%=0 THEN LowFlag%=1:LowMessage&=MessageNumber&
  483.  
  484.                          TxtBytes&=TxtBytes&+MsgBytes&
  485.                          Active%=Active%+1
  486.  
  487.                          xx&=MEM(0+40)+x&+188
  488.                          POKE LONG xx&,N_TotalBytes&
  489.                          OFFSet&=PEEK LONG(MEM(0+40)+x&+188)
  490.                          ErrLine$="<<Error HB3>> *":ErName$=MsgHdrBak$
  491.                          RECORD #2,0,N_MsgPosition&
  492.                          xy&=MEM(0+40)+x&
  493.                          ErrLine$="<<Error HB3-2>> *"
  494.                          WRITE FILE #2,xy&,206
  495.                          N_TotalBytes&=N_TotalBytes&+MsgBytes&
  496.                          N_MsgPosition&=N_MsgPosition&+206
  497.  
  498.                     END IF
  499.                     x&=x&+206
  500.                NEXT j%
  501.                GOSUB "Cursor_Spin"
  502.                radii%=40*R_MsgPosition&/R_MsgLength&
  503.                CIRCLE FILL 60,50,radii%
  504.                R_MsgPosition&=R_MsgPosition&+R_MsgCount&
  505.                LONG IF R_MsgPosition&+R_MsgCount& > R_MsgLength&
  506.                     aHold& = R_MsgLength&-R_MsgPosition&
  507.                     R_MsgCount&=aHold&
  508.                END IF
  509.          WEND
  510.          GOSUB "File_Dump"
  511.          ErrLine$="<<Error HT3-C>> *":ErName$=MsgHdrTemp$
  512.          CLOSE #1
  513.          ErrLine$="<<Error HB2-C>> *":ErName$=MsgHdrBak$
  514.          CLOSE #2
  515.          ErrLine$="<<Error T1-C>> *":ErName$=MsgTxtFilename$
  516.          CLOSE #3
  517.          ErrLine$="<<Error TB2-C>> *":ErName$=MsgTxtBak$
  518.          CLOSE #4
  519.          RESET
  520.          POKE LONG MEM(2+40)+50,LowMessage&
  521.          POKE LONG MEM(2+40)+54,HighMessage&
  522.          POKE LONG MEM(2+40)+58,N_TotalBytes&
  523.          ErrLine$="<<Error MB3>> *":ErName$=MessageBak$
  524.          OPEN "N",6,MessageBak$
  525.          ErrLine$="<<Error MB3-2>> *"
  526.          WRITE FILE #6,MEM(2+40),9242
  527.          CLOSE #6
  528.          RESET
  529.          GOSUB "Cursor_Spin"
  530.      
  531.     ErrLine$="<<Error HT5>> *":ErName$=MsgHdrTemp$
  532.        OPEN "N",1,MsgHdrTemp$
  533.     ErrLine$="<<Error HT5-C>> *"
  534.        CLOSE #1
  535.     RESET
  536.     ErrLine$="<<Error HT5-2>> *"
  537.        KILL MsgHdrTemp$
  538.        
  539.     ErrLine$="<<Error R1>> *":ErName$="Rename Error"
  540.        RENAME MsgHdrFilename$,HdrBak$
  541.     ErrLine$="<<Error R2>> *"
  542.        RENAME MsgTxtFilename$,TxtBak$
  543.     ErrLine$="<<Error R3>> *"
  544.        RENAME MessagesFile$,MsgBak$
  545.     ErrLine$="<<Error R4>> *"
  546.        RENAME MsgHdrBak$,MsgHdrFilename$
  547.     ErrLine$="<<Error R5>> *"
  548.        RENAME MsgTxtBak$,MsgTxtFilename$
  549.     ErrLine$="<<Error R6>> *"
  550.        RENAME MessageBak$,MessagesFile$
  551.        ON ERROR RETURN
  552.     GOSUB "Cursor_Spin"
  553.      
  554.      ScreenLine$="* Build File *"
  555.      DEF OPEN "TEXTEDIT"
  556.      ErrLine$="<<Error L0>> *":ErName$=Report$
  557.      ON ERROR GOSUB "SystemFile_Error"
  558.      OPEN "O",9,Report$
  559.      GOSUB "Cursor_Spin"
  560.      ErrLine$="<<Error L1>> *"
  561.      PRINT #9," "
  562.      PRINT #9,"                                          Mantissa, by Mike Lininger"
  563.      xhold$=STR$(TIMER-Start&)
  564.      Sec$="."+RIGHT$(xhold$,LEN(xhold$)-1)
  565.      MantissaTime&=TIMER-Start&
  566.      PRINT #9,"  Date: ";DATE$;"  Time: ";TIME$;Sec$
  567.      PRINT #9,"                                                          Limits"
  568.      PRINT #9,"      Message Section                Active   Deletes  Days  Section"
  569.      PRINT #9,"  ------------------------------------------------------------------"
  570.  
  571.      Active&=0:Delete&=0:SectionTotal&=0
  572.      GOSUB "Cursor_Spin"
  573.      FOR j%=1 TO 255
  574.           GOSUB "Cursor_Spin"
  575.           LONG IF MsgName$(j%) <> ""
  576.                LONG IF LEFT$(MsgName$(j%),3) = "---"
  577.                     a$=RIGHT$(MsgName$(j%),LEN(MsgName$(j%))-3)
  578.                     a$=a$+SPACE$(25)
  579.                XELSE
  580.                     a$=MsgName$(j%)+SPACE$(25)
  581.                END IF
  582.                a$=LEFT$(a$,25)
  583.                PRINT #9, "  ";
  584.                PRINT #9, USING "###";j%;
  585.                PRINT #9, ". ";a$;
  586.                PRINT #9, USING "#,###,###";SectionCount%(j%);:Active&=Active&+SectionCount%(j%)
  587.                PRINT #9, USING "#,###,###";SectionDelete%(j%);:Delete&=Delete&+SectionDelete%(j%)
  588.                PRINT #9, USING "#,###,###";SectionDay%(j%);
  589.                PRINT #9, USING "#,###,###";SectionLimit%(j%)
  590.                SectionTotal&=SectionTotal&+SectionLimit%(j%)
  591.          END IF
  592.      NEXT j%
  593.      PRINT #9,SPACE$(32);:PRINT #9," -------- --------          --------"
  594.      PRINT #9,SPACE$(24);:PRINT #9,"Totals: ";:PRINT #9,USING "#,###,###";Active&;:PRINT #9,USING "#,###,###";Delete&;
  595.      PRINT #9,SPACE$(9);:PRINT #9,USING "#,###,###";SectionTotal&
  596.      PRINT #9,SPACE$(41);:PRINT #9,USING "#,###,###";UserDelete&;:PRINT #9," - User  +"
  597.      PRINT #9,SPACE$(41);:PRINT #9,USING "#,###,###";DayDelete&;:PRINT #9," - Day   | Deletes "
  598.      PRINT #9,SPACE$(41);:PRINT #9,USING "#,###,###";LimitDelete&;:PRINT #9," - Limit + "
  599.      PRINT #9," "
  600.      PRINT #9,SPACE$(25);:PRINT #9,"    Low Message: ";:PRINT #9,USING "########";LowMessage&
  601.      PRINT #9,SPACE$(25);:PRINT #9,"   High Message: ";:PRINT #9,USING "########";HighMessage&
  602.      PRINT #9,SPACE$(25);:PRINT #9,"  Archived Msgs: ";:PRINT #9,USING "########";Archive%
  603.      PRINT #9,SPACE$(25);:PRINT #9,"    MsgTxt Size: ";:PRINT #9,USING "########";N_TotalBytes&;:PRINT #9," bytes"
  604.      PRINT #9,SPACE$(25);:PRINT #9,"    MsgHdr Size: ";:PRINT #9,USING "########";N_MsgPosition&;:PRINT #9," bytes"
  605.  
  606.      H&=VARPTR(TEMP$):POKE LONG H&+12,0:I&=VARPTR(A$):POKE LONG H&+18,I&
  607.      POKE WORD H&+22,0:POKE WORD H&+28,0:GET VOLUME INFO TEMP$
  608.      H1&=PEEK LONG(H&+48):X&=PEEK WORD(H&+62)
  609.      IF X& < 0 THEN X&=X&+65535
  610.      H2&=(H1&*X&)/1024
  611.  
  612.      PRINT #9,SPACE$(25);:PRINT #9,"Free Disk Space: ";:PRINT #9,USING "########";H2&;:PRINT #9," k"
  613.      PRINT #9,SPACE$(25);:PRINT #9,"    Free Memory: ";:PRINT #9,USING "########";MEM(-1);:PRINT #9," bytes"
  614.      PRINT #9,SPACE$(25);:PRINT #9,"       Run Time: ";:PRINT #9,USING "########";MantissaTime&;:PRINT #9," seconds"
  615.      CLOSE #9
  616.      RESET
  617.      ON ERROR RETURN
  618.      GOSUB "Cursor_Spin"
  619.      
  620. "Update_Skip"
  621.  
  622.      LONG IF b5%=2
  623.  
  624.           Start&=TIMER
  625.           FOR j%= 1 TO 255
  626.                SectionLimit%(j%)=0
  627.                SectionCount%(j%)=0
  628.           NEXT j%
  629.           R_MsgPosition&=0
  630.  
  631.           ScreenLine$="* ..scanning.. *"
  632.           GOSUB "Screen_Log_Display"
  633.           ErrLine$="<<Error H1>> *":ErName$=MsgHdrFilename$
  634.           ON ERROR GOSUB "SystemFile_Error"
  635.           OPEN "N",1,MsgHdrFilename$
  636.           ON ERROR RETURN
  637.    
  638.           GOSUB "Cursor_Spin"
  639.           R_MsgLength&=LOF(1,1)
  640.           R_MsgCount&=a&
  641.           LONG IF R_MsgLength& < R_MsgCount&
  642.                R_MsgCount&=R_MsgLength&
  643.           END IF
  644.  
  645.           WHILE NOT EOF(1)
  646.                GOSUB "Cursor_Spin"
  647.                ErrLine$="<<Error H2>> *":ErName$=MsgHdrFilename$
  648.                ON ERROR GOSUB "SystemFile_Error"
  649.                RECORD #1,0,R_MsgPosition&
  650.                ErrLine$="<<Error H2-2>> *"
  651.                READ FILE #1,MEM(0+40),R_MsgCount&
  652.                ON ERROR RETURN
  653.                RecordCount%=R_MsgCount&/206
  654.                x&=0
  655.                FOR j%=1 TO RecordCount%
  656.                     MessageNumber& = PEEK LONG(MEM(0+40)+x&+2)
  657.                     MessageSection%=CVI(CHR$(PEEK(MEM(0+40)+x&+6)))
  658.                     x&=x&+206
  659.             
  660.                     LONG IF MessageNumber& > OldMessageNumber&
  661.                          SectionCount%(MessageSection%)=SectionCount%(MessageSection%)+1
  662.                     END IF
  663.                     SectionLimit%(MessageSection%)=SectionLimit%(MessageSection%)+1
  664.  
  665.                NEXT j%
  666.                R_MsgPosition&=R_MsgPosition&+R_MsgCount&
  667.                LONG IF R_MsgPosition&+R_MsgCount& > R_MsgLength&
  668.                     aHold& = R_MsgLength&-R_MsgPosition&
  669.                     R_MsgCount&=aHold&
  670.                END IF
  671.          WEND
  672.          ErrLine$="<<Error H3>> *":ErName$=MsgHdrFilename$
  673.          ON ERROR GOSUB "SystemFile_Error"
  674.          CLOSE #1
  675.          RESET
  676.          ON ERROR RETURN
  677.  
  678.           GOSUB "Cursor_Spin"
  679.           ScreenLine$="* Build File *"
  680.           DEF OPEN "TEXTEDIT"
  681.           ErrLine$="<<Error E0>> *":ErName$=SysMsgName$
  682.           ON ERROR GOSUB "SystemFile_Error"
  683.           OPEN "O",9,SysMsgName$
  684.  
  685.           ErrLine$="<<Error E1>> *":ErName$=SysMsgName$
  686.           PRINT #9," "
  687.           PRINT #9,"  New Messages Delivered/Added Overnight!   Epistle IIm, by Mike Lininger"
  688.           xhold$=STR$(TIMER-Start&)
  689.           Sec$="."+RIGHT$(xhold$,LEN(xhold$)-1)
  690.           PRINT #9,"  Date: ";DATE$;"  Time: ";TIME$;Sec$
  691.           PRINT #9," "
  692.           PRINT #9,"      Message Section             New Msgs   Total Msgs   Message Type"
  693.           PRINT #9,"  -----------------------------------------------------------------------"
  694.  
  695.           FOR j%=1 TO 255
  696.                LONG IF MsgName$(j%) <> "" AND LEFT$(MsgName$(j%),3) <> "---"
  697.                     a$=MsgName$(j%)+SPACE$(25)
  698.                     a$=LEFT$(a$,25)
  699.                     PRINT #9, "  ";
  700.                     PRINT #9, USING "###";j%;
  701.                     PRINT #9, ". ";a$;
  702.                     PRINT #9, USING "##,###,###";SectionCount%(j%);
  703.                     PRINT #9, USING "#,###,###,###";SectionLimit%(j%);
  704.                     PRINT #9, "  ";
  705.                     IF MsgType$(j%)="1" THEN MessageType$=" Local Private**"
  706.                     IF MsgType$(j%)="2" THEN MessageType$=" Local Mail Area"
  707.                     IF MsgType$(j%)="3" THEN MessageType$=" NetMail Private"
  708.                     IF MsgType$(j%)="4" THEN MessageType$=" *Echo Mail Area"
  709.                     PRINT #9, MessageType$
  710.               END IF
  711.           NEXT j%
  712.           ErrLine$="<<Error E2>> *":ErName$=SysMsgName$
  713.           CLOSE #9
  714.           RESET
  715.           ON ERROR RETURN
  716.           GOSUB "Cursor_Spin"
  717.  
  718.           ' Updates the high message #, that was last processed by this routine
  719.           ' Write new High Message Number to STR 1889 in STR Resource.
  720.  
  721.           ScreenLine$="* Update Msg # *"
  722.           GOSUB "Screen_Log_Display"
  723.           GOSUB "Cursor_Spin"
  724.  
  725.           default$=STR$(MessageNumber&)
  726.           default$=RIGHT$(default$,LEN(default$)-1)
  727.           ResourceCount%=1899
  728.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  729.           CALL SETSTRING(StrHnd&,default$)
  730.           CALL CHANGEDRESOURCE(StrHnd&)
  731.           CALL UPDATERESFILE(Refnum%)
  732.  
  733.      END IF
  734.  
  735.      GOSUB "Cursor_Spin"
  736.      GOSUB "Tabby_Launch"
  737.  
  738.      ErrLine$ = "<<Error 00>> Everything Failed to Launch, Dropping to Finder "
  739.      GOSUB "Error Log"
  740.      IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  741.      RESET
  742.      END 
  743.  
  744.  
  745.  
  746. "File_Dump"
  747.  
  748.      LONG IF TxtBytes& > 0
  749.            Last&=64000
  750.            Loop%=0:Full%=0
  751.            IF TxtBytes& < Last& THEN Full%=1:Last& = TxtBytes&
  752.            WHILE Loop%=0
  753.                   GOSUB "Cursor_Spin"
  754.                   ON ERROR GOSUB "SystemFile_Error"
  755.                   ErrLine$="<<Error T2>> *":ErName$=MsgTxtFilename$
  756.                   RECORD #3,0,OldPosition&
  757.                   ErrLine$="<<Error T2-2>> *"
  758.                   READ FILE #3,MEM(1+40),Last&
  759.                   ErrLine$="<<Error TB3>> *":ErName$=MsgTxtBak$
  760.                   RECORD #4,0,NewPosition&
  761.                   ErrLine$="<<Error TB3-2>> *"
  762.                   WRITE FILE #4,MEM(1+40),Last&
  763.                   ON ERROR RETURN
  764.                   BytesWritten&=BytesWritten&+Last&
  765.                   OldPosition&=OldPosition&+Last&
  766.                   NewPosition&=NewPosition&+Last&
  767.                   IF Full%=1 THEN Loop%=1
  768.                   LONG IF Full%=0
  769.                        IF BytesWritten&+Last& > TxtBytes& THEN Full%=1:Last&=TxtBytes&-BytesWritten&
  770.                   END IF
  771.            WEND
  772.      END IF
  773.      GOSUB "Cursor_Spin"
  774.      RETURN
  775.  
  776.  
  777. "Backup_Message"
  778.  
  779.      GOSUB "Cursor_Spin"
  780.      To$="":From$="":Subject$=""
  781.      l%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+46)))
  782.      FOR k%=1 TO l%
  783.           To$=To$+CHR$(PEEK(MEM(0+40)+BPtr&+46+k%))
  784.      NEXT k%
  785.      l%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+14)))
  786.      FOR k%=1 TO l%
  787.           From$=From$+CHR$(PEEK(MEM(0+40)+BPtr&+14+k%))
  788.      NEXT k%
  789.      l%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+78)))
  790.      FOR k%=1 TO l%
  791.           Subject$=Subject$+CHR$(PEEK(MEM(0+40)+BPtr&+78+k%))
  792.      NEXT k%
  793.  
  794.      d1%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+8)))
  795.      d2%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+9)))
  796.      d3%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+10)))
  797.  
  798.      t1%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+11)))
  799.      t2%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+12)))
  800.      t3%=CVI(CHR$(PEEK(MEM(0+40)+BPtr&+13)))
  801.  
  802.      d1$=RIGHT$(STR$(d1%),LEN(STR$(d1%))-1)
  803.      d2$=RIGHT$(STR$(d2%),LEN(STR$(d2%))-1)
  804.      d3$=RIGHT$(STR$(d3%),LEN(STR$(d3%))-1)
  805.  
  806.      t1$=RIGHT$(STR$(d1%),LEN(STR$(d1%))-1)
  807.      t2$=RIGHT$(STR$(t2%),LEN(STR$(t2%))-1)
  808.      t3$=RIGHT$(STR$(t3%),LEN(STR$(t3%))-1)
  809.  
  810.      tm$=t1$+":"+t2$+":"+t3$
  811.      dt$=d1$+"/"+d2$+"/"+d3$
  812.  
  813.      Reply%=0:ReplyMsgNumber&=0
  814.      Status$=CHR$(PEEK(MEM(0+40)+BPtr&))
  815.      LONG IF (ASC(Status$) AND 8) = 8
  816.           ReplyMsgNumber&=PEEK LONG(MEM(0+40)+BPtr&+196)
  817.           Reply%=255
  818.      END IF
  819.  
  820.      MsgNumber&=PEEK LONG(MEM(0+40)+BPtr&+2)
  821.      MessageOffSet&=PEEK LONG(MEM(0+40)+BPtr&+188)
  822.      MsgLength&=PEEK LONG(MEM(0+40)+BPtr&+192)
  823.  
  824.      l%=LEN(MsgName$(Section%))
  825.      IF l%=0 THEN RETURN
  826.      LONG IF LEFT$(MsgName$(Section%),3) = "---"
  827.           SectionName$=RIGHT$(MsgName$(Section%),LEN(MsgName$(Section%))-3)
  828.           l%=LEN(SectionName$)
  829.           IF l% > 25 THEN l%=25
  830.      XELSE
  831.           SectionName$=MsgName$(Section%)
  832.           l%=LEN(SectionName$)
  833.           IF l% > 25 THEN l%=25
  834.      END IF
  835.      
  836.      SectionName$=LEFT$(SectionName$,l%)
  837.  
  838.      nm$=Archive$+SectionName$+".txt"
  839.  
  840.      ON ERROR GOSUB "Backup_Error"
  841.      ErrLine$="<<Error BK2-1>> *":ErName$=nm$
  842.      DEF OPEN "TEXTEDIT"
  843.      OPEN "A",11,nm$
  844.           IF BError%=255 THEN GOTO "BackupEnd"
  845.  
  846.           PRINT #11,"     To: ";To$;CHR$(13);
  847.           PRINT #11,"   From: ";From$;CHR$(13);
  848.           PRINT #11,"Subject: ";Subject$;CHR$(13);
  849.           PRINT #11,"   Date: ";dt$;" - ";tm$;CHR$(13);
  850.           
  851.           PRINT #11,"   Area: ";SectionName$;CHR$(13);
  852.           PRINT #11,"  Msg #:";:PRINT #11,USING "########";MsgNumber&;
  853.           
  854.           LONG IF Reply%=255
  855.                PRINT #11, " [Reply] to Msg #:";:PRINT #11, USING "########";ReplyMsgNumber&;CHR$(13);
  856.           XELSE
  857.                PRINT #11,CHR$(13);
  858.           END IF
  859.  
  860.           PRINT #11,CHR$(13);
  861.           MessageSize&=MessageOffSet&
  862.  
  863.           WHILE MessageSize& < MessageOffSet&+MsgLength&
  864.                ErrLine$="<<Error BK2-2>> *":ErName$=MsgTxtFilename$ 
  865.                RECORD #12,0,MessageSize&
  866.                IF BError%=255 THEN GOTO "BackupEnd"
  867.                ErrLine$="<<Error BK2-3>> *"
  868.                READ #12,Temp$;1
  869.                IF BError%=255 THEN GOTO "BackupEnd"
  870.                l%=ASC(Temp$)
  871.                ErrLine$="<<Error BK2-4>> *"
  872.                READ #12,Msgline$;l%
  873.                IF BError%=255 THEN GOTO "BackupEnd"
  874.                ErrLine$="<<Error BK2-5>> *":ErName$=nm$ 
  875.                PRINT #11,Msgline$;CHR$(13);
  876.                IF BError%=255 THEN GOTO "BackupEnd"
  877.                MessageSize&=MessageSize&+1+l%
  878.           WEND
  879.           ErrLine$="<<Error BK2-6>> *":ErName$=nm$ 
  880.           PRINT #11,CHR$(0)+CHR$(13);
  881.           Archive%=Archive%+1
  882.  
  883. "BackupEnd"
  884.  
  885.      ErrLine$="<<Error BK2-6>> *"
  886.      CLOSE #11
  887.      BError%=0
  888.      ON ERROR RETURN
  889.      GOSUB "Cursor_Spin"
  890.      RETURN
  891.  
  892.  
  893.  
  894. "Backup_Error"
  895.  
  896.      ErrLine$=ErrLine$+ErName$+"* Error"+STR$(ERROR)+" Invalid Name/Path, Missing, In Use, or Damaged"
  897.      GOSUB "Error Log"
  898.      ErrLine$="Message: "+ERRMSG$(ERROR)
  899.      GOSUB "Error Log"
  900.      ERROR=0:BError%=255
  901.      RETURN
  902.  
  903.  
  904. "Config_Read"
  905.  
  906.      ScreenLine$="* config. load *"
  907.      GOSUB "Screen_Log_Display"
  908.      ErrLine$="<<Error C0>> *":ErName$=ConfigFile$
  909.      ON ERROR GOSUB "SystemFile_Error"
  910.      OPEN "N",1,ConfigFile$
  911.      Length&=LOF(1,1)
  912.      LONG IF Length&=0
  913.           ErrLine$="<<Error C1>> *":ErName$=ConfigFile$
  914.           GOSUB "SystemFile_Error"
  915.      XELSE
  916.           ErrLine$="<<Error C2>> *":ErName$=ConfigFile$
  917.           RECORD #1,0,139
  918.           READ #1, MsgPath$;80
  919.           ErrLine$="<<Error C3>> *":ErName$=ConfigFile$
  920.              CLOSE #1
  921.           RESET
  922.           ON ERROR RETURN
  923.           LONG IF ASC(LEFT$(MsgPath$,1))>0
  924.                MessagesFile$=FN MakeString$(MsgPath$)+":MESSAGES"
  925.           XELSE
  926.                MessagesFile$=BBSFolder$+"MESSAGES": ' Default location
  927.           END IF
  928.  
  929.      END IF
  930.      RETURN
  931.  
  932.  
  933.  
  934. "SystemFile_Error"
  935.  
  936.      RESET
  937.      ErrLine$=ErrLine$+ErName$+"* Error"+STR$(ERROR)+" * - Invalid Name/Path, In Use, Missing, or Damaged! "
  938.      GOSUB "Error Log"
  939.      ErrLine$="Message: "+ERRMSG$(ERROR) 
  940.      GOSUB "Error Log"
  941.      ERROR=0
  942.      ScreenLine$="* file error *"
  943.      GOSUB "Screen_Log_Display"
  944.      GOSUB "Tabby_Launch"
  945.      ErrLine$ = "             *??* That is it folks, I am confuzzzzzed dropping to Finder *** "
  946.      GOSUB "Error Log"
  947.      ScreenLine$="* Drop Finder *"
  948.      GOSUB "Screen_Log_Display"
  949.      CURSOR 0
  950.      IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  951.      RESET
  952.      END
  953.  
  954.      RETURN
  955.      
  956.  
  957.  
  958.  
  959. "Messages_Read"
  960.  
  961.           ScreenLine$="* message load *"
  962.           GOSUB "Screen_Log_Display"
  963.           ErrLine$="<<Error M0>> *":ErName$=MessagesFile$
  964.           ON ERROR GOSUB "SystemFile_Error"
  965.           OPEN "N",5,MessagesFile$
  966.           ErrLine$="<<Error M1>> *":ErName$=MessagesFile$
  967.           RECORD #5,0,0
  968.           READ FILE #5,MEM(2+40),9242
  969.           ErrLine$="<<Error M2>> *":ErName$=MessagesFile$
  970.           CLOSE #5
  971.           RESET
  972.           ON ERROR RETURN
  973.           MsgPath$=""
  974.           a%=CVI(CHR$(PEEK(MEM(2+40))))
  975.           FOR j%=1 TO a%
  976.               MsgPath$=MsgPath$+CHR$(PEEK(MEM(2+40)+j%))
  977.           NEXT j%
  978.           LowMessage&=PEEK LONG(MEM(2+40)+50)
  979.           HighMessage&=PEEK LONG(MEM(2+40)+54)
  980.           MsgTxtBytes&=PEEK LONG(MEM(2+40)+58)
  981.           x&=62
  982.           FOR j%=1 TO 255
  983.               SectionType%=CVI(CHR$(PEEK(MEM(2+40)+x&+35)))
  984.                    LONG IF SectionType% > 0
  985.                         a%=CVI(CHR$(PEEK(MEM(2+40)+x&)))
  986.                         LONG IF a% > 0
  987.                              FOR k%=1 TO a%
  988.                                   MsgName$(j%)=MsgName$(j%)+CHR$(PEEK(MEM(2+40)+x&+k%))
  989.                              NEXT k%
  990.                         END IF
  991.                         MsgType$(j%)=RIGHT$(STR$(SectionType%),1)
  992.                         MessageSection$(j%)=RIGHT$(STR$(SectionType%),1)
  993.                         LONG IF b5%=2
  994.                              SecurityLevel%=CVI(CHR$(PEEK(MEM(2+40)+x&+26)))
  995.                              LONG IF SecurityLevel% > Clearance%
  996.                                   MsgName$(j%)="---"+MsgName$(j%)
  997.                              END IF
  998.                          END IF
  999.                    XELSE
  1000.                         MsgName$(j%)=""
  1001.                    END IF
  1002.                    x&=x&+36
  1003.            NEXT j%
  1004.        
  1005.            MsgHdrFilename$=MsgPath$+":"+"MSGHDR": ' Path to MSGHDR file
  1006.            MsgTxtFilename$=MsgPath$+":"+"MSGTXT": ' Path to MSGHDR file
  1007.  
  1008.            RETURN
  1009.  
  1010.  
  1011.  
  1012.  
  1013. "Get_Resource_Values"
  1014.  
  1015.      ' This module Gets default values from STR resources
  1016.      ' 1890 = BBS Application Name
  1017.      ' 1891 = Pathname To BBS Folder
  1018.      ' 1892 = Settings for Maintissa Text File
  1019.      ' 1893 = Report Log pathname
  1020.      ' 1894 = Delete by Day Y/N 2/1
  1021.      ' 1895 = Delete by Section Limit Y/N 2/1
  1022.      ' 1896 = Activate Epistle Y/N 2/1
  1023.      ' 1897 = Epistle Text File Name and Location
  1024.      ' 1898 = Clearance level for Epistle
  1025.      ' 1899 = Old High Message # for Epistle
  1026.      ' 1900 = Calls SystemTask (for tops and stuff) 2/1  On/Off
  1027.      ' 1901 = Pathname for archivial text files
  1028.  
  1029.      ' Find out what this application is named
  1030.  
  1031.       CurApName=&H910
  1032.       CurApName$=""
  1033.       GOSUB "Cursor_Spin"
  1034.  
  1035.       FOR I%=1 TO PEEK(CurApName)
  1036.                  CurApName$=CurApName$+CHR$(PEEK(CurApName+I%))
  1037.       NEXT I%
  1038.  
  1039.       rscs%=0:' ResFile is Closed
  1040.       Refnum%=FN OPENRESFILE(CurApName$)
  1041.       Errnum%=FN RESERROR
  1042.  
  1043.       LONG IF Errnum% <> 0
  1044.            ErrLine$ = "<<Error RS>> *":ErName$=CurApName$ 
  1045.            GOSUB "SystemFile_Error"
  1046.       END IF 
  1047.  
  1048.      rscs%=1:' ResFile is Open
  1049.      FOR ResourceCount%=1890 TO 1901
  1050.  
  1051.           GOSUB "Cursor_Spin"
  1052.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1053.  
  1054.           LONG IF StrHnd&=0
  1055.  
  1056.               ' Setting up string resource to save default strs
  1057.               IF ResourceCount% = 1890 THEN Str$="Red Ryder Host":RRHost$=Str$
  1058.               IF ResourceCount% = 1891 THEN Str$=":":BBSFolder$=Str$
  1059.               IF ResourceCount% = 1892 THEN Str$="Mantissa.data":Settings$=Str$
  1060.               IF ResourceCount% = 1893 THEN Str$="Mantissa.log":Report$=Str$
  1061.               IF ResourceCount% = 1894 THEN Str$="2":b3$=Str$:b3%=VAL(b3$)
  1062.               IF ResourceCount% = 1895 THEN Str$="2":b4$=Str$:b4%=VAL(b4$)
  1063.               IF ResourceCount% = 1896 THEN Str$="1":b5$=Str$:b5%=VAL(b5$)
  1064.               IF ResourceCount% = 1897 THEN Str$="Epistle.msg":SysMsgName$=Str$
  1065.               IF ResourceCount% = 1898 THEN Str$="0":Clearance$=Str$:Clearance%=0
  1066.               IF ResourceCount% = 1899 THEN Str$="0":OldHighMessage$=Str$:OldHighMessage&=VAL(Str$)
  1067.               IF ResourceCount% = 1900 THEN Str$="1":b6%=VAL(Str$)
  1068.               IF ResourceCount% = 1901 THEN Str$=":":Archive$=Str$
  1069.               
  1070.               StrHnd&=FN NEWSTRING(Str$)
  1071.               CALL ADDRESOURCE (StrHnd&,CVI("STR "),ResourceCount%,"")
  1072.        
  1073.           XELSE
  1074.  
  1075.                   StrHnd&=FN GETSTRING(ResourceCount%)
  1076.  
  1077.           END IF
  1078.  
  1079.           ' Convert STRs into useful limit values and pathnames
  1080.  
  1081.           Default$=FN ReturnString$(StrHnd&)
  1082.      
  1083.          IF ResourceCount% = 1890 THEN RRHost$=Default$
  1084.          IF ResourceCount% = 1891 THEN BBSFolder$=Default$
  1085.          IF ResourceCount% = 1892 THEN Settings$=Default$
  1086.          IF ResourceCount% = 1893 THEN Report$=Default$
  1087.          IF ResourceCount% = 1894 THEN b3%=VAL(Default$)
  1088.          IF ResourceCount% = 1895 THEN b4%=VAL(Default$)
  1089.          IF ResourceCount% = 1896 THEN b5%=VAL(Default$)
  1090.          IF ResourceCount% = 1897 THEN SysMsgName$=Default$
  1091.          IF ResourceCount% = 1898 THEN Clearance$=Default$:Clearance%=VAL(Default$)
  1092.          IF ResourceCount% = 1899 THEN OldMessageNumber$=Default$:OldMessageNumber&=VAL(Default$)
  1093.          IF ResourceCount% = 1900 THEN b6%=VAL(Default$)
  1094.          IF ResourceCount% = 1901 THEN Archive$=Default$
  1095.  
  1096.      NEXT ResourceCount%
  1097.  
  1098.      IF LEN(Archive$)=0 THEN Archive$=":"
  1099.      LONG IF RIGHT$(Archive$,1) <> ":"
  1100.           Archive$=Archive$+":"
  1101.      END IF
  1102.      GOSUB "Cursor_Spin"
  1103.  
  1104. RETURN
  1105.  
  1106.  
  1107. "Tabby_Launch"
  1108.  
  1109.      RESET
  1110.      GOSUB "Cursor_Spin"
  1111.      EventCount%=0:ERROR=0
  1112.      DEF OPEN "TEXTQED1"
  1113.  
  1114.      ScreenLine$="* check launch *"
  1115.      GOSUB "Screen_Log_Display"
  1116.      GOSUB "Cursor_Spin"
  1117.  
  1118.      ON ERROR GOSUB "Tabby_Launch_Error"
  1119.      OPEN "N",1,NextLaunch$
  1120.           Length&=LOF(1,1)
  1121.      CLOSE #1
  1122.      RESET
  1123.      GOSUB "Cursor_Spin"
  1124.  
  1125.      LONG IF Length&=0
  1126.           ScreenLine$="* file error *"
  1127.           GOSUB "Screen_Log_Display"
  1128.           ErrLine$ = "<<Error 01>> *"+NextLaunch$+"* Does not Exist at end of Indicated Path! "
  1129.           GOSUB "Error Log"
  1130.           ErrLine$ = "<<Error K1a>> *:ErName$=NextLaunch$
  1131.           KILL NextLaunch$
  1132.           GOTO "Launch_Sequence_Start"
  1133.      END IF
  1134.  
  1135.      ScreenLine$="* load launch *"
  1136.      GOSUB "Screen_Log_Display"
  1137.  
  1138.      ErrLine$ = "<<Error L6>> *:ErName$=NextLaunch$
  1139.      OPEN "I",2,NextLaunch$
  1140.  
  1141.      ErrLine$ = "<<Error L6-1>> *
  1142.      WHILE NOT EOF(2)
  1143.  
  1144.           GOSUB "Cursor_Spin"
  1145.           INPUT #2,Tabby$(EventCount%)
  1146.           EventCount%=EventCount%+1
  1147.  
  1148.      WEND
  1149.      CLOSE #2
  1150.      RESET
  1151.      GOSUB "Cursor_Spin"
  1152.  
  1153.      EventCount%=EventCount%-1
  1154.  
  1155.      LONG IF EventCount% < 1
  1156.           ScreenLine$="* delete launch *"
  1157.           GOSUB "Screen_Log_Display"
  1158.          ErrLine$ = "<<Error L6-3>> *
  1159.           KILL NextLaunch$
  1160.      XELSE
  1161.           ScreenLine$="* update launch *"
  1162.           GOSUB "Screen_Log_Display"
  1163.           ErrLine$ = "<<Error L6-4>> *
  1164.           OPEN "O",3,NextLaunch$
  1165.               ErrLine$ = "<<Error L6-5a>> *
  1166.               FOR Count%= 1 TO EventCount%
  1167.                    GOSUB "Cursor_Spin"
  1168.                    ErrLine$ = "<<Error L6-5b>> *
  1169.                    PRINT #3,Tabby$(Count%);
  1170.                    GOSUB "Cursor_Spin"
  1171.                    LONG IF Tabby$(Count%+1) = ""
  1172.                         ErrLine$ = "<<Error L6-5c>> *
  1173.                         PRINT #3,CHR$(13);
  1174.                    XELSE
  1175.                         ErrLine$ = "<<Error L6-5d>> *
  1176.                         PRINT #3,",";
  1177.                    END IF
  1178.               NEXT Count%
  1179.           ErrLine$ = "<<Error L6-6>> *
  1180.           CLOSE #3
  1181.           RESET
  1182.      END IF
  1183.  
  1184. "Launch_Sequence_Start"
  1185.  
  1186.      RESET
  1187.      LaunchFile$=BBSFolder$+Tabby$(0)
  1188.  
  1189.      IF UCASE$(Tabby$(0))="BBS" THEN LaunchFile$=RRHost$
  1190.      
  1191.      GOSUB "Check_Valid_Filenames"
  1192.  
  1193.      LONG IF Tabby$(0) <> ""
  1194.  
  1195.           GOSUB "Cursor_Spin"
  1196.           ScreenLine$="* launching *"
  1197.           GOSUB "Screen_Log_Display"
  1198.  
  1199.           CURSOR 0
  1200.           LONG IF FileErr1%=255
  1201.                ScreenLine$="* file error *"
  1202.                GOSUB "Screen_Log_Display"
  1203.                ErrLine$ = "<<Error 02>> *"+LaunchFile$+"* Does not Exist at end of Indicated Path! "
  1204.                GOSUB "Error Log"
  1205.                ErrLine$ = "             "+"Attempt is being Made to Run *"+RRHost$+"* "
  1206.                GOSUB "Error Log"
  1207.  
  1208.                ScreenLine$="* launch BBS *"
  1209.                GOSUB "Screen_Log_Display"
  1210.                LONG IF FileErr2%=0
  1211.                     ScreenLine$="* file error *"
  1212.                     GOSUB "Screen_Log_Display"
  1213.                     ErrLine$ = "<<Error 03>> *"+RRHost$+"* Does not Exist at end of Indicated Path! "
  1214.                     GOSUB "Error Log"
  1215.                     ErrLine$ = "             "+"Attempt is being Made to Run *"+TabbyNet$+"* "
  1216.                     GOSUB "Error Log"
  1217.  
  1218.                     ScreenLine$="* launch tabby *"
  1219.                     GOSUB "Screen_Log_Display"
  1220.                     LONG IF FileErr3%=255
  1221.                          ScreenLine$="*file error *"
  1222.                          GOSUB "Screen_Log_Display"
  1223.                          ErrLine$ = "<<Error 04>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  1224.                          GOSUB "Error Log"
  1225.                          ErrLine$ = "             *** That is it folks, I am confuzzzzzed dropping to Finder *** "
  1226.                          GOSUB "Error Log"
  1227.                          ScreenLine$="* Drop Finder *"
  1228.                          GOSUB "Screen_Log_Display"
  1229.                          CURSOR 0
  1230.                          IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1231.                          RESET
  1232.                          END
  1233.                     XELSE
  1234.                          RESET
  1235.                          RUN TabbyNet$
  1236.                          END
  1237.                     END IF
  1238.                XELSE
  1239.                     RESET
  1240.                     RUN RRHost$
  1241.                     END
  1242.                END IF
  1243.           XELSE
  1244.                RESET
  1245.                RUN LaunchFile$
  1246.                END
  1247.           END IF
  1248.  
  1249.       XELSE
  1250.  
  1251.           CURSOR 0
  1252.           ScreenLine$="* launch BBS *"
  1253.           GOSUB "Screen_Log_Display"
  1254.           LONG IF FileErr2%=255
  1255.                ScreenLine$="* file error *"
  1256.                GOSUB "Screen_Log_Display"
  1257.                ErrLine$ = "<<Error 05>> *"+RRHost$+"* Does not Exist at end of Indicated Path! "
  1258.                GOSUB "Error Log"
  1259.                ErrLine$ = "             "+"Attempt is being Made to Run *"+TabbyNet$+"* "
  1260.                GOSUB "Error Log"
  1261.  
  1262.                ScreenLine$="* launch tabby *"
  1263.                GOSUB "Screen_Log_Display"
  1264.                LONG IF FileErr3%=255
  1265.                     ScreenLine$="* file error *"
  1266.                     GOSUB "Screen_Log_Display"
  1267.                     ErrLine$ = "<<Error 06>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  1268.                     GOSUB "Error Log"
  1269.                     ErrLine$ = "             *** That is it folks, I am dropping to Finder *** "
  1270.                     GOSUB "Error Log"
  1271.                     ScreenLine$="* Drop Finder *"
  1272.                     GOSUB "Screen_Log_Display"
  1273.                     CURSOR 0
  1274.                     IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1275.                     RESET
  1276.                     END
  1277.                XELSE
  1278.                     RESET
  1279.                     RUN TabbyNet$
  1280.                     END
  1281.                END IF
  1282.           XELSE
  1283.                RESET
  1284.                RUN RRHost$
  1285.                END
  1286.           END IF
  1287.  
  1288.      END IF
  1289.  
  1290.      CURSOR 0
  1291.      ErrLine$ = "<<Error 99>> "+" Really Big ERROR, Sequence Abort, attempting to Recover "
  1292.      GOSUB "Error Log"
  1293.      ScreenLine$="* launch BBS *"
  1294.      GOSUB "Screen_Log_Display"
  1295.      LONG IF FileErr2%=255
  1296.           ScreenLine$="* file error *"
  1297.           GOSUB "Screen_Log_Display"
  1298.           ErrLine$ = "<<Error 07>> "+RRHost$+" Does not Exist at end of Indicated Path! "
  1299.           GOSUB "Error Log"
  1300.           ErrLine$ = "             "+"Attempt is being Made to Run *TabbyNet* "
  1301.           GOSUB "Error Log"
  1302.  
  1303.           ScreenLine$="* launch tabby *"
  1304.           GOSUB "Screen_Log_Display"
  1305.           
  1306.           LONG IF FileErr3%=255
  1307.                ScreenLine$="* file error *"
  1308.                GOSUB "Screen_Log_Display"
  1309.                ErrLine$ = "<<Error 08>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  1310.                GOSUB "Error Log" 
  1311.                ErrLine$ = "             *** That is it folks, I am confuzzzzzzed @?$-&!#, dropping to Finder *** "
  1312.                GOSUB "Error Log"
  1313.                ScreenLine$="* Drop Finder *"
  1314.                GOSUB "Screen_Log_Display"
  1315.                CURSOR 0
  1316.                IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1317.                RESET
  1318.                END
  1319.           XELSE
  1320.                RESET
  1321.                RUN TabbyNet$
  1322.                END
  1323.           END IF
  1324.           RESET
  1325.           RUN RRHost$
  1326.           END
  1327.      END IF
  1328.  
  1329.      ON ERROR RETURN
  1330.  
  1331.      RETURN  
  1332.  
  1333.  
  1334. "Tabby_Launch_Error"
  1335.  
  1336.      RESET
  1337.      GOSUB "Cursor_Spin"
  1338.      ErrLine$=ErrLine$+ErName$
  1339.      GOSUB "Error Log"
  1340.      ScreenLine$="* drop finder *"
  1341.      GOSUB "Screen_Log_Display"
  1342.      ErrLine$="<<Error"+STR$(ERROR)+">> Launch Error Possible Causes are as Follows: "
  1343.      GOSUB "Error Log"
  1344.      ErrLine$="Message: "+ERRMSG$(ERROR) 
  1345.      ERROR=0
  1346.      GOSUB "Error Log"
  1347.      ErrLine$="<<------- Report String - *"+Report$+"* "
  1348.      GOSUB "Error Log"
  1349.      ErrLine$="<<---------- BBS String - *"+RRHost$+"* "
  1350.      GOSUB "Error Log"
  1351.      ErrLine$="<<-- Launch.Next String - *"+NextLaunch$+"* "
  1352.      GOSUB "Error Log"
  1353.      ErrLine$="<<----- TabbyNet String - *"+TabbyNet$+"* "
  1354.      GOSUB "Error Log"
  1355.      ErrLine$="<<--- BBS Folder String - *"+BBSFolder$+"* "
  1356.      GOSUB "Error Log"
  1357.      ErrLine$="<<------- Config String - *"+ConfigFile$+"* "
  1358.      GOSUB "Error Log"
  1359.      ErrLine$="<<----- Messages String - *"+MessagesFile$+"* "
  1360.      GOSUB "Error Log"
  1361.      ErrLine$="<<------- MsgHdr String - *"+MsgHdrFilename$+"* "
  1362.      GOSUB "Error Log"
  1363.      ErrLine$="<<------- MsgTxt String - *"+MsgTxtFilename$+"* "
  1364.      GOSUB "Error Log"
  1365.      ErrLine$="<<--- Next Event String - *"+LaunchFile$+"* "
  1366.      GOSUB "Error Log"
  1367.      ErrLine$="<<------ Epistle String - *"+SysMsgName$+"* "
  1368.      GOSUB "Error Log"
  1369.      ErrLine$="<<-- One of the Above is Wrong! - Application Not There! - Invalid Pathname! - Can't Run A File! "
  1370.      GOSUB "Error Log"     
  1371.      ErrLine$="*    *** Dropping to Finder, I am Confuzzzzzzed @%?$-*$%! "
  1372.      GOSUB "Error Log"
  1373.      ERROR = 0
  1374.      CURSOR 0
  1375.      IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1376.      RESET
  1377.      END
  1378.      RETURN
  1379.  
  1380.  
  1381.  
  1382. "Check_Valid_Filenames"
  1383.     
  1384.      ErrFile%=0:FileErr1%=0:FileErr2%=0:FileErr3%=0
  1385.  
  1386.      ON ERROR GOSUB "Filename_Error"
  1387.    
  1388.      a%=1
  1389.      OPEN "I",2,LaunchFile$
  1390.      CLOSE #2     
  1391.      LONG IF FileErr1%=255
  1392.           GOSUB "Cursor_Spin"
  1393.           ErrLine$="<<Error 09>> *"+LaunchFile$+"* Next Event Not Found - Invalid Name or Path "
  1394.           GOSUB "Error Log"
  1395.           ScreenLine$="* File Error *"
  1396.           GOSUB "Screen_Log_Display"
  1397.      END IF
  1398.  
  1399.      a%=2
  1400.      OPEN "I",2,RRHost$
  1401.      CLOSE #2
  1402.      LONG IF FileErr2%=255
  1403.           GOSUB "Cursor_Spin"
  1404.           ErrLine$="<<Error 10>> *"+RRHost$+"* BBS Not Found - Invalid Name or Path "
  1405.           GOSUB "Error Log"
  1406.           ScreenLine$="* File Error *"
  1407.           GOSUB "Screen_Log_Display"
  1408.      END IF
  1409.  
  1410.      a%=3
  1411.      OPEN "I",2,TabbyNet$
  1412.      CLOSE #2
  1413.      LONG IF FileErr3%=255
  1414.           GOSUB "Cursor_Spin"
  1415.           ErrLine$="<<Error 11>> *"+TabbyNet$+"* TabbyNet Not Found - Invalid Name or Path "
  1416.           GOSUB "Error Log"
  1417.           ScreenLine$="* File Error *"
  1418.           GOSUB "Screen_Log_Display"
  1419.      END IF
  1420.  
  1421.      ON ERROR RETURN
  1422.      RETURN
  1423.  
  1424.  
  1425.  
  1426. "Filename_Error"
  1427.  
  1428.      IF a%=1 THEN FileErr1%=255
  1429.      IF a%=2 THEN FileErr2%=255
  1430.      IF a%=3 THEN FileErr3%=255
  1431.      ERROR=0
  1432.  
  1433.      RETURN
  1434.  
  1435.  
  1436. "Screen_Log_Display"
  1437.  
  1438.      GOSUB "Cursor_Spin"
  1439.      TEXT 0,12,0,0     
  1440.      T%=100:L%=7:B%=116:R%=120:TEMP$=ScreenLine$
  1441.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 1)
  1442.      GOSUB "Cursor_Spin"
  1443.      RETURN
  1444.  
  1445.  
  1446. "Error Log"
  1447.  
  1448.      GOSUB "Cursor_Spin"
  1449.      DEF OPEN "TEXTTEps"
  1450.      OPEN "A",7,"Mantissa.Error"
  1451.           GOSUB "Cursor_Spin"
  1452.           ErrLine$=ErrLine$+TIME$+" "+DATE$
  1453.           PRINT #7, ErrLine$
  1454.      CLOSE #7
  1455.      GOSUB "Cursor_Spin"
  1456.      RETURN
  1457.  
  1458.  
  1459.  
  1460.  
  1461. "Configure Menu"
  1462.  
  1463.     Field%=1
  1464.     CURSOR 0
  1465.     GOSUB "Build Window"
  1466.  
  1467.     ON DIALOG GOSUB "Handle Dialog"
  1468.     DIALOG ON
  1469.  
  1470.  
  1471. "Loop"
  1472.  
  1473.     LONG IF Button%=1
  1474.          WINDOW CLOSE #1
  1475.          RETURN
  1476.     END IF
  1477.     LONG IF Button%=2
  1478.          GOSUB "Resource Update"
  1479.          WINDOW CLOSE #1
  1480.          RETURN
  1481.      END IF
  1482.  
  1483.      GOTO "Loop"
  1484.      DIALOG OFF
  1485.  
  1486.  
  1487.  
  1488. "Handle Dialog"
  1489.  
  1490.      Act%=DIALOG(0):Ref%=DIALOG(Act%)
  1491.  
  1492.      IF Act%=3 THEN WINDOW Ref%:RETURN
  1493.      LONG IF Act%=1 AND Ref%=1
  1494.           Button%=2
  1495.      END IF
  1496.      LONG IF Act%=1 AND Ref%=2
  1497.           Button%=1
  1498.      END IF
  1499.      LONG IF Act%=6 OR Act%=7
  1500.           Field%=Field%+1
  1501.           LONG IF b5%=1
  1502.                IF Field%>4 THEN Field%=1
  1503.           XELSE
  1504.                IF Field%>7 THEN Field%=1
  1505.           END IF
  1506.           EDIT FIELD #Field%
  1507.      END IF
  1508.      LONG IF Act%=1 AND Ref%=3
  1509.           LONG IF b3%=2
  1510.                b3%=1
  1511.           XELSE 
  1512.                b3%=2
  1513.           END IF
  1514.           BUTTON 3 ,b3%
  1515.      END IF
  1516.      LONG IF Act%=1 AND Ref%=4
  1517.           LONG IF b4%=2
  1518.                b4%=1
  1519.           XELSE 
  1520.                b4%=2
  1521.           END IF
  1522.           BUTTON 4 ,b4%
  1523.  
  1524.      END IF
  1525.      LONG IF Act%=1 AND Ref%=5
  1526.           LONG IF b5%=2
  1527.                b5%=1
  1528.                WINDOW 1,"",(55,43)-(427,280),2
  1529.                T%=218:L%=4:B%=248:R%=272:PEN ,,,,19
  1530.                CALL PAINTRECT(T%)
  1531.                IF Field%>4 THEN Field%=1
  1532.                EDIT FIELD #Field%
  1533.           XELSE 
  1534.                b5%=2
  1535.                WINDOW 1,"",(55,43)-(427,317),2
  1536.                EDIT FIELD 5,SysMsgName$,(76,230)-(252,245),3,1
  1537.                EDIT FIELD 6,Clearance$,(76,254)-(109,269),3,1
  1538.                EDIT FIELD 7,OldMessageNumber$,(193,254)-(252,269),3,1
  1539.           END IF
  1540.           BUTTON 5 ,b5%
  1541.  
  1542.      END IF
  1543.  
  1544.      LONG IF Act%=2
  1545.           EDIT FIELD #Ref%
  1546.           Field%=Ref%
  1547.      END IF
  1548.      LONG IF Act%=5 
  1549.          GOSUB "Format Window"
  1550.          EDIT FIELD #Field%
  1551.          FLUSHEVENTS
  1552.      END IF
  1553.      RETURN
  1554.  
  1555.  
  1556.  
  1557. "Frame Button"
  1558.  
  1559.      CALL INSETRECT(T%,-4,-4)
  1560.      PEN 3,3,1,8,0
  1561.      CALL FRAMEROUNDRECT(T%,16,16)
  1562.      CALL INSETRECT(T%,4,4):CALL PENNORMAL
  1563.      RETURN
  1564.  
  1565.  
  1566.  
  1567. "Build Window"
  1568.     
  1569.      LONG IF b5%=1
  1570.           WINDOW 1,"",(55,43)-(427,280),2
  1571.      XELSE
  1572.           WINDOW 1,"",(55,43)-(427,317),2
  1573.      END IF
  1574.      GOSUB "Format Window"
  1575.      GOSUB "Build Edits"
  1576.      RETURN
  1577.  
  1578.  
  1579.  
  1580. "Format Window"
  1581.  
  1582.      CALL PENNORMAL
  1583.      'RefNum%=FN OPENRESFILE("dd80:ZBasic:Mantissa.pict") 
  1584.      Pict&=FN GETRESOURCE(CVI("PICT"),24610)
  1585.      PICTURE(245,0),Pict&
  1586.      T%=135:L%=25:B%=167:R%=57
  1587.      CALL PLOTICON(T%,FN GETICON(257))
  1588.      CALL PENNORMAL
  1589.  
  1590.      TEXT 3,10,1,0
  1591.      T%=8:L%=8:B%=21:R%=71:TEMP$="BBS Name:"
  1592.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1593.      T%=32:L%=1:B%=45:TEMP$="BBS Folder:"
  1594.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1595.      T%=56:L%=18:B%=69:TEMP$="Settings:"
  1596.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1597.      T%=80:L%=26:B%=93:TEMP$="Report:"
  1598.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1599.      PEN 1,1,1,8
  1600.      T%=3:L%=72:B%=25:R%=222:CALL FRAMERECT(T%)
  1601.      T%=27:B%=49:CALL FRAMERECT(T%)
  1602.      T%=51:B%=73:R%=257:CALL FRAMERECT(T%)
  1603.      T%=75:B%=97:CALL FRAMERECT(T%)
  1604.      T%=106:L%=76:B%=119:R%=192:TEMP$="• Delete Messages •"
  1605.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1606.      T%=126:L%=110:B%=139:R%=169:TEMP$="Day Limit"
  1607.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1608.      T%=145:L%=111:B%=158:R%=191:TEMP$="Section Limit"
  1609.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1610.      T=164:L=111:B=177:R=168:TEMP$="Epistle II"
  1611.      CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1612.      T%=188:L%=40:B%=208:R%=99:GOSUB "Frame Button"
  1613.  
  1614.      LONG IF b5%=2
  1615.           T%=227:L%=72:B%=249:R%=256
  1616.           CALL FRAMERECT(T%)
  1617.           T%=232:L%=20:B%=245:R%=72:TEMP$="Txt File:"
  1618.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1619.           T%=56:L%=19:B%=69:TEMP$="Settings:"
  1620.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1621.           T%=255:L%=11:B%=268:R%=73:TEMP$="Clearance:"
  1622.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1623.           L%=125:R%=189:TEMP$="Old Msg #:"
  1624.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1625.           T%=251:L%=72:B%=273:R%=112
  1626.           CALL FRAMERECT(T%)
  1627.           L%=191:R%=256
  1628.           CALL FRAMERECT(T%)
  1629.           T%=221:L%=10:B%=221:R%=270
  1630.           CALL MOVETO(L%,T%):CALL LINETO(R%,B%)
  1631.           T%=218:B%=218:R%=270:PEN 2,2
  1632.           CALL MOVETO(L%,T%):CALL LINETO(R%,B%)
  1633.           T%=243:L%=286:B%=259:R%=343:TEMP$="Epistle II"
  1634.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T%, 0)
  1635.      END IF
  1636.  
  1637.      TEXT 0,12,0,0
  1638.  
  1639.      RETURN
  1640.  
  1641.  
  1642.  
  1643. "Build Edits"
  1644.  
  1645.     TEXT ,,0,0
  1646.  
  1647.     LONG IF WINDOW(0)=1
  1648.  
  1649.         TEXT 0,12,0,0
  1650.         EDIT FIELD 1,RRHost$,(76,6)-(218,21),3,1
  1651.         EDIT FIELD 2,BBSFolder$,(76,30)-(218,45),3,1
  1652.         EDIT FIELD 3,Settings$,(76,54)-(255,69),3,1
  1653.         EDIT FIELD 4,Report$,(76,78)-(255,93),3,1
  1654.  
  1655.         LONG IF b5%=2
  1656.              EDIT FIELD 5,SysMsgName$,(76,230)-(255,245),3,1
  1657.              EDIT FIELD 6,Clearance$,(76,254)-(109,269),3,1
  1658.              EDIT FIELD 7,OldMessageNumber$,(193,255)-(252,269),3,1
  1659.         END IF
  1660.  
  1661.  
  1662.         BUTTON 3 ,b3%," ",(88,124)-(112,139),2
  1663.         BUTTON 4 ,b4%," ",(88,143)-(112,158),2
  1664.         BUTTON 5, b5%," ",(88,162)-(112,177),2
  1665.         BUTTON 1 ,1," Save ",(40,188)-(100,208),1
  1666.         BUTTON 2 ,1,"Cancel",(164,188)-(228,208),1
  1667.         
  1668.         EDIT FIELD #Field%
  1669.  
  1670.     END IF
  1671.  
  1672.     RETURN
  1673.  
  1674.  
  1675.  
  1676. "Resource Update"
  1677.  
  1678.      GOSUB "Cursor_Spin"
  1679.      a$=EDIT$(2)
  1680.      Check$=RIGHT$(a$,1)
  1681.      Button%=0:Act%=0:Ref%=0
  1682.      IF Check$ <> ":" THEN BEEP:EDIT FIELD #2:GOTO "Loop"
  1683.  
  1684.      RCount%=0
  1685.      FOR ResourceCount%=1890 TO 1893
  1686.                
  1687.           GOSUB "Cursor_Spin"
  1688.           RCount%=RCount%+1
  1689.           default$ = EDIT$(RCount%)
  1690.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1691.           CALL SETSTRING(StrHnd&,default$)
  1692.           CALL CHANGEDRESOURCE(StrHnd&)
  1693.           CALL UPDATERESFILE(Refnum%)
  1694.  
  1695.       NEXT ResourceCount%
  1696.       IF b3%=2 THEN default$="2" ELSE default$="1"
  1697.       StrHnd&=FN GETRESOURCE(CVI("STR "),1894)
  1698.       CALL SETSTRING(StrHnd&,default$)
  1699.       CALL CHANGEDRESOURCE(StrHnd&)
  1700.       CALL UPDATERESFILE(Refnum%)
  1701.       GOSUB "Cursor_Spin"
  1702.       IF b4%=2 THEN default$="2" ELSE default$="1"
  1703.       StrHnd&=FN GETRESOURCE(CVI("STR "),1895)
  1704.       CALL SETSTRING(StrHnd&,default$)
  1705.       CALL CHANGEDRESOURCE(StrHnd&)
  1706.       CALL UPDATERESFILE(Refnum%)
  1707.       GOSUB "Cursor_Spin"
  1708.       IF b5%=2 THEN default$="2" ELSE default$="1"
  1709.       StrHnd&=FN GETRESOURCE(CVI("STR "),1896)
  1710.       CALL SETSTRING(StrHnd&,default$)
  1711.       CALL CHANGEDRESOURCE(StrHnd&)
  1712.       CALL UPDATERESFILE(Refnum%)
  1713.  
  1714.      LONG IF b5%=2
  1715.           RCount%=4
  1716.           FOR ResourceCount%=1897 TO 1899
  1717.                
  1718.                GOSUB "Cursor_Spin"
  1719.                RCount%=RCount%+1
  1720.                default$ = EDIT$(RCount%)
  1721.                StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1722.                CALL SETSTRING(StrHnd&,default$)
  1723.                CALL CHANGEDRESOURCE(StrHnd&)
  1724.                CALL UPDATERESFILE(Refnum%)
  1725.  
  1726.            NEXT ResourceCount%
  1727.  
  1728.       END IF
  1729.       CURSOR 0
  1730.  
  1731.       RETURN
  1732.  
  1733.  
  1734. "Cursor_Spin"
  1735.  
  1736.      Cur%=Cur%+1
  1737.      IF Cur% > 131 THEN Cur%=128
  1738.      CURSOR Cur%
  1739.      IF b6%=2 THEN CALL SYSTEMTASK
  1740.      RETURN
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746. Shareware price for mantissa is $30.00.  
  1747.  
  1748.      The following is a list of features in Mantissa 3.2.
  1749.  
  1750.      Mantissa is a message base management utility, that helps SS/Tabby
  1751.      sysops maintain the high volume of echo and local mail that enter
  1752.      and leave their system.
  1753.  
  1754.      o Each message section can have a unique:
  1755.           o Day limit (0-999)
  1756.           o Section Limit (0-999)
  1757.           o Archive Limit (0-999k)*
  1758.           o Archive Location (any valid path)*
  1759.      o Archives can have unique or the same archive paths*
  1760.      o nonSection messages are automatically deleted*
  1761.      o Global Limit Set Option*
  1762.      o Global Day Limit Set Option*
  1763.      o Global Archive Limit Set Option*
  1764.      o Global Archive Location Set Option*
  1765.      o Control 'set' Buttons for Setting unique Pathnames*
  1766.      o Multiple ways to move from section to section*
  1767.           o List Manager Scroll Feature*
  1768.           o Popup Menus*
  1769.           o Control Button Forward/Reverse*
  1770.           o Menu Commands*
  1771.           o Command Keys*
  1772.      o On Line Help*
  1773.      o Full Support of Mac Interface
  1774.      o Delete by Age Only
  1775.      o Delete by Limit Only
  1776.      o Delete by both Age/Limit
  1777.      o Master Archive On/Off switch*
  1778.      o Individual Delete/Limit ON/OFF Markers*
  1779.      o Renumber Messages*
  1780.           o Renumber Forward from message #1*
  1781.           o Renumber Reverse from high Message No.*
  1782.           o Renumber Userlog, High message last read*
  1783.           o Renumber on Specified Dates Only*
  1784.      o Use STR's or Text file to save settings.*
  1785.      o Network and Remote Maintenance supported
  1786.      o Turn Mantissa Log On/Off
  1787.      o Select Location and Name of Mantissa Log
  1788.      o Epistle Generator
  1789.           o On/Off Epistle Generator
  1790.           o Max. Message Level Show Clearance
  1791.           o Select location/name of Epistle Report
  1792.           o Append/Erase Epistle Report
  1793.      o Keep .Bak's or discard them*
  1794.      o Security marker for High Clearance sections*
  1795.      o Major speed boost over 1.0
  1796.      o Tabby Compatible or Standalone        * - New in 3.x version
  1797.  
  1798.  
  1799. In addition to Mantissa 3.2 Registered users are provided with the 
  1800. updated Export 3.2.  Export is a utility that is essential if you run 
  1801. SS and Tabby.  Export 3.2 has been greatly expanded and turbo charged.
  1802. Sysop are are given extraordinary control over data exported from their 
  1803. system.  Export 3.2, Probe 3.2, PreStamp 3.2 and Sundial 3.2 are only 
  1804. being made available to Registered Mantissa users.
  1805.  
  1806. Options Available in Export 3.2:
  1807.  
  1808.      o Point Message Support*     
  1809.      o Process all/new Messages*
  1810.      o Delete NetMail as Processed
  1811.      o Notify Sysop of Export*
  1812.      o Summary of Last 5 Exports*
  1813.      o Append Origin to Netmail
  1814.      o D'Bridge Areafix support
  1815.      o Turn Log on/off
  1816.      o Select location/name of log
  1817.      o Append directly to Tabby Log
  1818.      o Full support of mac interface
  1819.      o Use Short/Long Reports
  1820.      o Node Alias for Netmail*
  1821.      o Use Generic Echoes/Seenby.bbs files*
  1822.      o Compatible with Origin Master (by Lance Rasmussen)
  1823.      o On Line Help*
  1824.      o Major speed boost over 2.52
  1825.      o Erase/Append to Log*       * - New in 3.x version
  1826.  
  1827.  
  1828. Utilities from, Lininger Technology:
  1829.  
  1830.                    Free to all         Registered Mantissa
  1831. Versions
  1832.  
  1833. Export                2.54                  3.2
  1834. Import                2.53                  2.53 (update soon)
  1835. Sundial               2.1                   3.2
  1836. PreStamp              2.0                   3.2
  1837. Mantissa              1.0 (demo)            3.2
  1838. Probe                  .53                  3.2
  1839. R.Prestamp            2.0                   2.0  (update soon)
  1840. Sapphire              2.1t                  2.1t (update soon)
  1841. Epistle II            1.0                   1.0   
  1842. TPort                 1.0                   1.0
  1843. *Pleiades (1)         -NA-                   .25 (Phase 1 only)
  1844.  
  1845.  
  1846. Special thanks to,
  1847.     Tom Fitzsimmons, Mark Bryant, Lance Rasmussen & Ralph Merritt
  1848. for their great ideas and for risking life and data while beta testing
  1849. the above products.
  1850.  
  1851.  
  1852. Mantissa($30.00):
  1853. Lininger Technology
  1854. Suite 'A'
  1855. 385 Bowling Green Place
  1856. Gahanna, Ohio  43230
  1857. 614-471-6209  226/200
  1858.  
  1859.  
  1860.  
  1861. Applications Freq. from 1:226/200 or 1:350/90
  1862.  
  1863. For General Release:
  1864.  
  1865. Epistle1.sit - Epistle II 1.0
  1866. Export25.sit - Export 2.54
  1867. Import25.sit - Import 2.53
  1868. Mant10.sit   - Mantissa 1.0
  1869. PreStp20.sit - Prestamp 2.0
  1870. Probe.53.sit - Probe .53
  1871. RPreSt20.sit - R.Prestamp (Robot)
  1872. Sapph21t.sit - Sapphire 2.1t
  1873. Sundil21.sit - Sundial 2.1
  1874. TPort10.sit  - TabbyPort 1.0
  1875. TurboT.sit   - TurboPascal launch.next source (original by Pete Johnson)
  1876. ZLaunch.sit  - ZBasic launch.next source code
  1877.  
  1878.                No password required to get the above files
  1879.  
  1880.  
  1881.  
  1882. For Restistered Mantissa Users:
  1883.  
  1884. Export32.sit <password> - Export 3.21
  1885. Mant32.sit   <password> - Mantissa 3.2
  1886. PreStp32.sit <password> - PreStamp 3.2
  1887. Probe32.sit  <password> - Proble 3.2
  1888. Sundil32.sit <Password> - Sundial 3.2
  1889.  
  1890.              <Password> is the first 4 uppercase characters of the filename
  1891.                         mentioned in your Mantissa registration cover letter 
  1892.                         that accompanied your master disk.
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.